//
//  DWDStatuses.swift
//  dwdWb
//
//  Created by Dengdwd on 15/10/11.
//  Copyright © 2015年 dwd. All rights reserved.
//

import UIKit

class DWDStatuses: NSObject {

    var created_at:String?
    var id:NSInteger = 0
    var text:String?
    var source:String?
    var user:User?
    var pic_urls:[[String:String]]?
//  转发
    var reposts_count:Int? = 0
//  评论
    var comments_count:Int? = 0
//  赞
    var attitudes_count:Int? = 0
//  转发微博
    var retweeted_status:DWDStatuses?
    
    init(dict:[String:AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    override func setValue(value: AnyObject?, forKey key: String) {
        if key == "user" {
            user = User(dict:value as! [String:AnyObject])
            return
        }
        if key == "retweeted_status" {
            retweeted_status = DWDStatuses(dict: value as! [String:AnyObject])
            return
        }
        
        super.setValue(value, forKey: key)
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) { }
    override var description : String {
        let keys = ["created_at","id","text","source","user","pic_urls"]
        return "\(dictionaryWithValuesForKeys(keys))"
    }
}

